<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
</head>
<body>
<script>
    function test(){
        num = 100;
        function a(){
            num ++;
            console.log(num);
        }
        function b(){
            num --;
            console.log(num);
        }
        return [a,b];
    }
    var myArr = test();
    myArr[0]();
    myArr[1]();
</script>

</body>
</html>
